<%@ page import="com.demo.javabean.UserBean"%>
<%
	//get parameter
	String username = request.getParameter("username");
	String password = request.getParameter("password");
	
	//check null
	if (username.equals("") || password.equals(""))
		response.sendRedirect("login.jsp");
	else {
		UserBean userbean = new UserBean();
		boolean isValid = userbean.valid(username, password);
		
		if (isValid) {
			session.setAttribute("username", username);
			response.sendRedirect("welcome.jsp");
		}
		else
			response.sendRedirect("login.jsp");
	}
%> 